package vn.smartoffice.promail.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import vn.smartoffice.promail.entity.MailContact;
import vn.smartoffice.promail.mapper.MailContactMapper;
import vn.smartoffice.promail.services.BaseService;
import vn.smartoffice.promail.services.MailContactService;

@Service("mailContactService")
@Transactional
public class MailContactServiceImpl extends BaseService<MailContact, MailContactMapper> implements MailContactService {

	@Autowired
	public MailContactServiceImpl(MailContactMapper mapper) {
		super(mapper);
	}

	public List<MailContact> findByUserId(long userId) {
		return mapper.findByUserId(userId);
	}

	@Override
	public List<MailContact> findByKeyword(String keyword) {
		return mapper.findByKeyword(keyword);
	}

	@Override
	public List<MailContact> findByUserGroupId(long userId, long groupId) {
		return mapper.findByUserGroupId(userId, groupId);
	}

	@Override
	public void deleteByUserGroupId(long userId, long groupId) {
		mapper.deleteByUserGroupId(userId, groupId);
	}

}
